package cn.zxy.model;

import lombok.Data;

@Data

public class ResponseDTO {
    private int code;
    private String message;
    private Object data;

    //成功
    public static ResponseDTO success(Object data){
        ResponseDTO dto = new ResponseDTO();
        dto.setData(data);
        return dto;
    }

    //失败
    public static ResponseDTO error(int code,String msg){
        ResponseDTO dto = new ResponseDTO();
        dto.setCode(code);
        dto.setMessage(msg);
        return dto;
    }
}
